<template>
  <div>
    <el-row>
  <el-col :span="8" v-for="(o, index) in list" :key="index"  >
    <el-card :body-style="{ padding: '0px' }">
      <img :src=o.url class="image">
      <div style="padding: 14px;">
        <span>{{o.descs}}</span>
        <div class="bottom clearfix">
    
            <span>￥{{o.money}}</span>
          

<van-rate v-model="value" :count="6" />
          <el-button type="text" class="button" @click="goods(o.id)">操作按钮</el-button>
        </div>
      </div>
    </el-card>
  </el-col>
</el-row>
  </div>
</template>

<script>
export default {
     data() {
    return {
      currentDate: new Date(),
      list:[],
      userid:localStorage.getItem('userid'),
            value: 5,
            aa:this.$route.path

    };
  },
  methods:{
    getgoods(){
        this.axios.get('getorder')
        .then(res=>{
            this.list = res.data.data

        })
    },
    goods(id){
        this.axios.post('addgoods',{goodsid:id,userid:this.userid})
        .then(res=>{
            alert(res.data.msg)
            this.$router.push('/shopping')
        })
    },
    getbrowsing(){
    this.axios.get('browsing?userid='+this.userid+'&url='+this.aa)
    .then(res=>{
        console.log(res)
    })
  }
  },
  mounted(){
    this.getgoods()
    this.getbrowsing()
  }

}
</script>

<style>
 .time {
    font-size: 13px;
    color: #999;
  }
  
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  
  .clearfix:after {
      clear: both
  }
</style>